import { type pageInfo } from '@/page/types/base/baseRequestPage'

export interface goodsSpec {
  id: string
  /**
   * 类型枚举
   */
  typeId: string
  /**
   * 规格id
   */
  name: string
  /**
   * 参数
   */

  param: string
  /**
   * 介绍
   */
  describes: string
  /**
   * 创建时间
   */
  createTime: string
}
export interface goodsSpecDetail {
  id: string
  /**
   * 名称
   */
  name: string
  /**
   * 参数
   */

  param: string
  /**
   * 介绍
   */
  describes: string
}
export interface goodsSpecS extends pageInfo {
  name: string
  /**
   * 名称
   */
  specDetailName: string
  /**
   * 类型id
   */
  typeId: string
}
export interface goodsSpecEdit {
  id: string
  /**
   * 类型枚举
   */
  typeId: string
  /**
   * 规格id
   */
  name: string
  /**
   * 参数
   */

  param: string
  /**
   * 图片url
   */
  imageUrl: string
  /**
   * 介绍
   */
  describes: string
}
export interface goodsSpecDetailEdit {
  id: string
  /**
   * 规格id
   */
  name: string

  /**
   * 参数
   */

  param: string
  /**
   * 介绍
   */
  describes: string
}
export class goodsSpecClass {
  goodsSpecs: goodsSpecS = {
    name: '',
    specDetailName: '',
    typeId: '',
    page: 1,
    size: 10,
    total: 0
  }
  goodsSpecTable = []
  goodsSpecDialog = false
  goodsSpecDetailDialog = false
  goodsTypes = []
  index = 0
  goodsSpecId = ''
  goodsSpecDetails = [
    {
      id: '',
      name: '',
      param: ''
    }
  ]
  goodsSpecEdit: goodsSpecEdit = {
    id: '',
    typeId: '',
    name: '',
    param: '',
    describes: '',
    imageUrl: ''
  }
  props = {
    label: 'name',
    value: 'id',
    children: 'children',
    emitPath: false
  }
  goodsSpecRule = {
    typeId: [
      {
        required: true,
        message: '类型不能为空',
        trigger: 'change'
      }
    ],
    name: [
      {
        required: true,
        message: '名称不能为空',
        trigger: 'blur'
      }
    ],
    param: [
      {
        required: true,
        message: '参数不能为空',
        trigger: 'blur'
      }
    ]
  }
}
